import ctypes, sys
import traceback
from getpath import getpath
initpath=getpath()
sys.path.insert(0,initpath+"\Lib")
from main2 import main
print(sys.path)
def is_admin():
    try:
        return ctypes.windll.shell32.IsUserAnAdmin()
    except:
        return False
if is_admin():
    # 将要运行的代码加到这里
    try:
        main()
    except:
        traceback.print_exc()
        a=input("error ")
else:
    if sys.version_info[0] == 3:
    	ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
    	main()
